babl.git
10 years agorelease: 0.1.14
Øyvind Kolås [Thu, 19 Nov 2015 20:05:17 +0000 (21:05 +0100)]
release: 0.1.14

10 years agoNEWS, AUTHORS: updates
Øyvind Kolås [Thu, 19 Nov 2015 20:05:07 +0000 (21:05 +0100)]
NEWS, AUTHORS: updates

10 years agobabl_format_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:59:35 +0000 (16:59 +0300)]
babl_format_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==1657==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fd3026d6c20 at pc 0x7fd3026b6e4a bp 0x7fffaac308a0 sp 0x7fffaac30898
READ of size 4 at 0x7fd3026d6c20 thread T0
    0 0x7fd3026b6e49 in babl_format_new /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317
    1 0x7fd3026bf44f in construct_double_format /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:259
    2 0x7fd3026bfd12 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:204
    3 0x7fd3026acce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
    4 0x7fd3026a9379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    5 0x7fd306e5a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    6 0x7fd301f5d238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    7 0x7fd301f5e193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    8 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    9 0x7fd300f71b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    10 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7fd3026d6c23 is located 0 bytes to the right of global variable '*.LC8' from 'babl-model.c' (0x7fd3026d6c20) of size 3
  '*.LC8' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317 babl_format_new
Shadow bytes around the buggy address:
  0x0ffae04d2d70: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 02 f9
=>0x0ffae04d2d80: f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9 00 02 f9 f9
  0x0ffae04d2d90: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==1657==ABORTING

10 years agobabl_model_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:57:20 +0000 (16:57 +0300)]
babl_model_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==31464==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f1c25907940 at pc 0x7f1c258f7636 bp 0x7ffdc4838670 sp 0x7ffdc4838668
READ of size 4 at 0x7f1c25907940 thread T0
    0 0x7f1c258f7635 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114
    1 0x7f1c258e4ce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
    2 0x7f1c258e1379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f1c2a0923d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f1c25195238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f1c25196193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f1c241a9b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f1c25907943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f1c25907940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114 babl_model_new
Shadow bytes around the buggy address:
  0x0fe404b18f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe404b18f20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0fe404b18f30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==31464==ABORTING

10 years agobabl_component_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:54:21 +0000 (16:54 +0300)]
babl_component_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==28935==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f6e2393f940 at pc 0x7f6e23919b5f bp 0x7ffc7b9ca770 sp 0x7ffc7b9ca768
READ of size 4 at 0x7f6e2393f940 thread T0
    0 0x7f6e23919b5e in babl_component_new /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82
    1 0x7f6e2391cbda in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:96
    2 0x7f6e23919379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f6e280ca3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f6e231cd238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f6e231ce193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f6e221e1b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f6e2393f943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f6e2393f940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82 babl_component_new
Shadow bytes around the buggy address:
  0x0fee4471ff10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fee4471ff20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0fee4471ff30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==28935==ABORTING

10 years agobabl_type_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:50:55 +0000 (16:50 +0300)]
babl_type_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==25849==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f7faec97940 at pc 0x7f7faec8b9bc bp 0x7ffd22ab9210 sp 0x7ffd22ab9208
READ of size 4 at 0x7f7faec97940 thread T0
    0 0x7f7faec8b9bb in babl_type_new /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88
    1 0x7f7faec74ba9 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:90
    2 0x7f7faec71379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f7fb342a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f7fae525238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f7fae526193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f7fad539b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f7faec97943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f7faec97940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88 babl_type_new
Shadow bytes around the buggy address:
  0x0ff075d8af10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ff075d8af20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0ff075d8af30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==25849==ABORTING

10 years agobabl_parse_double: permit 0 and 9 after .
Øyvind Kolås [Sun, 21 Jun 2015 20:25:41 +0000 (22:25 +0200)]
babl_parse_double: permit 0 and 9 after .

spotted by massimo, before this fix BABL_TOLERANCE < 0.1 and != 0 was not
possible.

10 years agoRevert "build: add --enable-installed-tests parameter"
Øyvind Kolås [Fri, 29 May 2015 03:05:32 +0000 (05:05 +0200)]
Revert "build: add --enable-installed-tests parameter"

This reverts commit 1457ff4d59f1e2fccdf7e09e5725a698afbc5d22.

10 years agoFix generation of test pixels
Loren Merritt [Fri, 29 May 2015 00:37:26 +0000 (00:37 +0000)]
Fix generation of test pixels

Most of the test data was zeros. Which produced innacurate benchmarks of any
conversion paths whose speed is data-dependent, such as gamma correction.

10 years agobuild: add --enable-installed-tests parameter
Vadim Rutkovsky [Thu, 7 Aug 2014 15:39:57 +0000 (17:39 +0200)]
build: add --enable-installed-tests parameter

See https://live.gnome.org/GnomeGoals/InstalledTests for more information.
Those tests will also be executed on http://build.gnome.org

It's still possible to run `make check` with locally uninstalled tests.

10 years agoCIE: minor cleanups
Thomas Manni [Wed, 20 May 2015 23:33:54 +0000 (01:33 +0200)]
CIE: minor cleanups

Use macros for kappa, epsilon and D50 reference white in all places
Remove duplicated comments

10 years agoCIE: new conversions to/from "CIE Lab alpha float" and "RGBA float"
Thomas Manni [Wed, 20 May 2015 10:12:35 +0000 (12:12 +0200)]
CIE: new conversions to/from "CIE Lab alpha float" and "RGBA float"

10 years agoDon't create a mutexattr for each mutex
Mukund Sivaraman [Wed, 22 Apr 2015 08:10:06 +0000 (13:40 +0530)]
Don't create a mutexattr for each mutex

10 years agoDon't repeat the malloc/free function pointer change messages
Mukund Sivaraman [Sun, 19 Apr 2015 19:30:58 +0000 (01:00 +0530)]
Don't repeat the malloc/free function pointer change messages

10 years agoRemove unnecessary stat()
Mukund Sivaraman [Sun, 12 Apr 2015 15:17:18 +0000 (20:47 +0530)]
Remove unnecessary stat()

10 years agobabl-mutex: Local headers first, remove unused
Jon Nordby [Wed, 18 Mar 2015 15:19:24 +0000 (16:19 +0100)]
babl-mutex: Local headers first, remove unused

Ensures the feature macros are set for all includes,
and that the public header does not implicitly rely
on any of the headers included in .c file

10 years agobabl-mutex: Define _GNU_SOURCE instead of __USE_GNU
Jon Nordby [Wed, 18 Mar 2015 11:07:01 +0000 (12:07 +0100)]
babl-mutex: Define _GNU_SOURCE instead of __USE_GNU

__USE_GNU should only be set internally by the libc feature detect macros.
On older Debian-based systems, as used by Heroku cedar-10 stack, this failed
to provide the definition of PTHREAD_MUTEX_RECURSIVE

11 years agoDisplay whether a format is planar
Mukund Sivaraman [Sun, 1 Mar 2015 10:57:55 +0000 (16:27 +0530)]
Display whether a format is planar

11 years agoSupport more than 100 formats
Mukund Sivaraman [Sun, 1 Mar 2015 07:56:05 +0000 (13:26 +0530)]
Support more than 100 formats

11 years agoFix another place where assigned_name can be NULL
Mukund Sivaraman [Thu, 26 Feb 2015 15:03:16 +0000 (20:33 +0530)]
Fix another place where assigned_name can be NULL

11 years agoAllow up to (and including) BABL_MAX_COMPONENTS
Mukund Sivaraman [Thu, 26 Feb 2015 14:51:18 +0000 (20:21 +0530)]
Allow up to (and including) BABL_MAX_COMPONENTS

11 years agoAvoid shadowing babl variable
Mukund Sivaraman [Thu, 26 Feb 2015 14:46:23 +0000 (20:16 +0530)]
Avoid shadowing babl variable

11 years agoUse common return
Mukund Sivaraman [Thu, 26 Feb 2015 14:40:35 +0000 (20:10 +0530)]
Use common return

11 years agoassigned_name can be NULL, causing segfault
Mukund Sivaraman [Thu, 26 Feb 2015 14:37:46 +0000 (20:07 +0530)]
assigned_name can be NULL, causing segfault

11 years agoRemove deadcode
Mukund Sivaraman [Thu, 26 Feb 2015 14:32:38 +0000 (20:02 +0530)]
Remove deadcode

11 years agoFix type max value for consistency
Mukund Sivaraman [Thu, 26 Feb 2015 14:27:14 +0000 (19:57 +0530)]
Fix type max value for consistency

11 years agoRemove workaround for non-recursive mutexes.
Nils Philippsen [Fri, 13 Feb 2015 12:29:13 +0000 (13:29 +0100)]
Remove workaround for non-recursive mutexes.

This workaround caused concurrency-stress-test to fail occasionally.
Meanwhile BablMutex wraps pthread mutexes in a way that they are
initialized as recursive.

This partially reverts commit 9d2aa7d13ac421935de1e87301c48af50b0ceb59.

11 years agoMake BablMutex recursive on all platforms.
Nils Philippsen [Fri, 13 Feb 2015 12:24:52 +0000 (13:24 +0100)]
Make BablMutex recursive on all platforms.

Win32 Critical Sections are recursive locks, initialize pthread mutexes
as recursive as well.

11 years agoChange constants to match built-in sRGB profiles. modified: babl/base/rgb-constants.h
Elle Stone [Sat, 7 Feb 2015 17:12:46 +0000 (12:12 -0500)]
Change constants to match built-in sRGB profiles. modified: babl/base/rgb-constants.h

11 years agopost release version bump
Øyvind Kolås [Tue, 3 Feb 2015 17:41:07 +0000 (18:41 +0100)]
post release version bump

11 years agorelease 0.1.12
Øyvind Kolås [Tue, 3 Feb 2015 17:40:47 +0000 (18:40 +0100)]
release 0.1.12

11 years agoNEWS: update
Øyvind Kolås [Tue, 3 Feb 2015 17:35:25 +0000 (18:35 +0100)]
NEWS: update

11 years agoAUTHORS: add more people
Øyvind Kolås [Tue, 3 Feb 2015 17:05:20 +0000 (18:05 +0100)]
AUTHORS: add more people

11 years agoCIE: minor cleanups
Øyvind Kolås [Tue, 30 Dec 2014 02:07:41 +0000 (03:07 +0100)]
CIE: minor cleanups

Update copyright block, some reindentation and removal of some dead/obsolete
comments and code.

11 years agotest: update srgb_to_lab_u8 test
Øyvind Kolås [Tue, 30 Dec 2014 01:52:27 +0000 (02:52 +0100)]
test: update srgb_to_lab_u8 test

11 years agoModify CIE color space conversions to use D50-adapted sRGB
Elle Stone [Mon, 29 Dec 2014 21:42:50 +0000 (16:42 -0500)]
Modify CIE color space conversions to use D50-adapted sRGB

11 years agoroadmap: make statement about tentativeness more explicit
Øyvind Kolås [Sun, 16 Nov 2014 03:11:36 +0000 (03:11 +0000)]
roadmap: make statement about tentativeness more explicit

also add comment about significance of rounding errors relative to sensor/CCD
precision.

11 years agospell out roadmap with more detailed overview
Øyvind Kolås [Sat, 11 Oct 2014 18:37:11 +0000 (20:37 +0200)]
spell out roadmap with more detailed overview

11 years agodocs: added a roadmap/architecture document.
Øyvind Kolås [Thu, 9 Oct 2014 17:16:38 +0000 (19:16 +0200)]
docs: added a roadmap/architecture document.

11 years agobabl: Fix message printed when memory function pointers don't match
Mukund Sivaraman [Wed, 3 Sep 2014 04:39:55 +0000 (10:09 +0530)]
babl: Fix message printed when memory function pointers don't match

11 years agoextensions: Register CMYK u8 format
Jon Nordby [Mon, 11 Aug 2014 23:48:21 +0000 (01:48 +0200)]
extensions: Register CMYK u8 format

11 years agoextensions: Fix M/Y channels swapped for CMYK float
Jon Nordby [Mon, 11 Aug 2014 23:45:13 +0000 (01:45 +0200)]
extensions: Fix M/Y channels swapped for CMYK float

Pretty sure CMYK should have channel order cmyk and not cymk

11 years agoRemove extra programming languages from the doap file.
Michael Henning [Thu, 7 Aug 2014 23:45:05 +0000 (19:45 -0400)]
Remove extra programming languages from the doap file.

11 years agoDOAP file: add Ruby programming language.
Sven Claussner [Thu, 7 Aug 2014 17:47:58 +0000 (19:47 +0200)]
DOAP file: add Ruby programming language.

11 years agoFix DOAP file
Sven Claussner [Wed, 6 Aug 2014 19:42:17 +0000 (21:42 +0200)]
Fix DOAP file

Remove category.
Remove M4 programming language, because we don't develop with it
(only the Autotools use it internally).

11 years agoUpdate babl.doap and AUTHORS
Sven Claussner [Sun, 3 Aug 2014 05:38:39 +0000 (07:38 +0200)]
Update babl.doap and AUTHORS

Make babl.doap compliant to the new DOAP file style (GUADEC 2014):
* Add new mandatory fields 'description' and 'programming-language'.
* Add field 'category'

Add bug tracker URL.
Update mailing list adress.
Remove trailing white spaces.
Add me to AUTHORS.

11 years agoFix crash if failing to normalize path for loading extensions
Jon Nordby [Fri, 18 Jul 2014 16:00:20 +0000 (18:00 +0200)]
Fix crash if failing to normalize path for loading extensions

Can for instance happen when running with "BABL_PATH=something:",
which easily happens in scripts on form BABL_PATH=something:${BABL_PATH}

11 years agobabl: make malloc implementation stability sanity check non-fatal
Øyvind Kolås [Wed, 2 Jul 2014 04:20:13 +0000 (06:20 +0200)]
babl: make malloc implementation stability sanity check non-fatal

11 years agoextensions: use more integer instructions for float lookups
Øyvind Kolås [Sun, 29 Jun 2014 19:22:14 +0000 (21:22 +0200)]
extensions: use more integer instructions for float lookups

11 years agoextension: make rgb8 to rgba8 conversion faster
Øyvind Kolås [Sun, 29 Jun 2014 18:15:11 +0000 (20:15 +0200)]
extension: make rgb8 to rgba8 conversion faster

For all pixels but the last one, do a 32bit load/store + 8bit immediate store
instead of byte by byte copying.

11 years agoadd internal babl_parse_double; to avoid using atof
Øyvind Kolås [Mon, 9 Jun 2014 00:30:38 +0000 (02:30 +0200)]
add internal babl_parse_double; to avoid using atof

atof is locale dependent; it was being used two places parsing floating point
values from environment variables.

11 years agoextend conversions to n_components to pad with 0s
Øyvind Kolås [Mon, 28 Apr 2014 21:36:04 +0000 (23:36 +0200)]
extend conversions to n_components to pad with 0s

Test coverage updated to check these cases.

11 years agoimprove how RGBA buffers are copied to n_component
Øyvind Kolås [Mon, 28 Apr 2014 13:34:51 +0000 (15:34 +0200)]
improve how RGBA buffers are copied to n_component

11 years agoadd n_components casting test
Øyvind Kolås [Mon, 28 Apr 2014 13:49:39 +0000 (15:49 +0200)]
add n_components casting test

11 years agoresolve ambiguous calling of real_babl_log with va_args
Paul Fredrickson [Tue, 18 Mar 2014 03:17:43 +0000 (20:17 -0700)]
resolve ambiguous calling of real_babl_log with va_args

In babl-internal.h there are two different ways of calling real_babl_log.
One matches the macro definitions of babl_log which expects an arbitrary
number of parameters, and the other is to pass a va_list used to access
those parameters. The latter case can be found in the function definition
of babl_log when an appropriate macro definition is not selected.

It may be that some platforms implement varargs in such a way that
passing a va_list pointing to the params of another call stack is the
same as passing those parameters directly, but that definitely isn't
the case on mac OS X, where this results in corrupted strings when
calling babl_log or babl_fatal.

The solution here is to create a varargs-enabled version of real_babl_log
that accepts a va_list, and have all calls eventually call into that.

(This may not be seen under normal configurations. This was discovered
while trying to build with a hand-crafted config.h in Xcode.)

11 years agoFix const warning
Daniel Sabo [Wed, 5 Mar 2014 12:56:15 +0000 (04:56 -0800)]
Fix const warning

11 years agoRevert "Use absolute error instead of average error for path check"
Daniel Sabo [Fri, 28 Feb 2014 00:25:45 +0000 (16:25 -0800)]
Revert "Use absolute error instead of average error for path check"

I would still like to use absolute error in the future because it
would remove the relationship between the number of zeros in the
test pixels and the total error score, but we do not seem to be at
a stage where that is practical yet (bug 725339).

This reverts commit 56be40fbef61fd32672209d38a5e874fea603e82.

Conflicts:
babl/babl-fish-path.c

12 years agotests: Use rand when random is unavailable
Daniel Sabo [Sun, 2 Feb 2014 07:13:28 +0000 (23:13 -0800)]
tests: Use rand when random is unavailable

12 years agoDisable babl-gen-test-pixels when random is missing
Daniel Sabo [Sun, 2 Feb 2014 04:22:49 +0000 (20:22 -0800)]
Disable babl-gen-test-pixels when random is missing

babl-gen-test-pixels is only needed to regenerate the source
pixels and doesn't need to be run as part of the normal build
process.

12 years agoAdd automake 1.13+ test outputs to .gitignore
Daniel Sabo [Sun, 2 Feb 2014 04:32:24 +0000 (20:32 -0800)]
Add automake 1.13+ test outputs to .gitignore

12 years agoAdd babl-ref-pixels.inc to EXTRA_DIST
Daniel Sabo [Fri, 31 Jan 2014 07:48:26 +0000 (23:48 -0800)]
Add babl-ref-pixels.inc to EXTRA_DIST

12 years agoRemove old references to introspection
Daniel Sabo [Fri, 31 Jan 2014 07:47:48 +0000 (23:47 -0800)]
Remove old references to introspection

12 years agoUse a static set of reference pixels
Daniel Sabo [Fri, 10 Jan 2014 09:51:30 +0000 (01:51 -0800)]
Use a static set of reference pixels

The ref pixels are stored in babl/babl-ref-pixels.inc which
is generated by tools/babl-gen-test-pixels.

12 years agointrospect: Print full precision for the path error
Daniel Sabo [Sun, 12 Jan 2014 02:46:35 +0000 (18:46 -0800)]
introspect: Print full precision for the path error

12 years agoUse absolute error instead of average error for path check
Daniel Sabo [Sun, 12 Jan 2014 02:44:32 +0000 (18:44 -0800)]
Use absolute error instead of average error for path check

12 years agoRemove bad RGB -> Y conversions
Daniel Sabo [Fri, 20 Dec 2013 21:01:12 +0000 (13:01 -0800)]
Remove bad RGB -> Y conversions

12 years agoMostly remove BablImage from babl-fish-reference.c
Daniel Sabo [Tue, 15 Oct 2013 05:22:59 +0000 (22:22 -0700)]
Mostly remove BablImage from babl-fish-reference.c

There is no valid way to trigger these paths, and the BABL_IS_BABL
call on image data produces false positives (see bug 698913).

12 years agoRemove broken introspection bindings
Daniel Sabo [Thu, 10 Oct 2013 12:30:58 +0000 (05:30 -0700)]
Remove broken introspection bindings

They primarily existed to support GEGL, and there are more
solid wrappers around the related functions in GEGL now.

12 years agoPrefer clang as the compiler on OSX >= 10.7
Daniel Sabo [Thu, 10 Oct 2013 12:39:50 +0000 (05:39 -0700)]
Prefer clang as the compiler on OSX >= 10.7

12 years agoRequest a C99 compatible compiler
Daniel Sabo [Wed, 9 Oct 2013 06:17:57 +0000 (23:17 -0700)]
Request a C99 compatible compiler

12 years agoUse SSE2 u16 conversions for gamma <-> gamma
Daniel Sabo [Sun, 30 Jun 2013 12:12:52 +0000 (05:12 -0700)]
Use SSE2 u16 conversions for gamma <-> gamma

12 years agobase: For RGB->Y, use sRGB primaries that are adapted to a D50 illuminant.
Michael Henning [Sun, 29 Sep 2013 16:48:04 +0000 (12:48 -0400)]
base: For RGB->Y, use sRGB primaries that are adapted to a D50 illuminant.

Thanks to Elle Stone for pointing this out.

12 years agoIncrease the precision of ref gamma conversions
Daniel Sabo [Sun, 14 Jul 2013 06:42:08 +0000 (23:42 -0700)]
Increase the precision of ref gamma conversions

Use a 3 round Newtons method for the fast version. This should be
fully accurate for floats in [0, 1], less so for very small values
but they're in the the linear part of the sRGB curve.

For the reference conversions the standard C pow() function is
used, which give accuracy far in excess of anything we need.

12 years agotests: output with more details when grayscale_to_rgb fails
Téo Mazars [Sun, 4 Aug 2013 18:14:31 +0000 (20:14 +0200)]
tests: output with more details when grayscale_to_rgb fails

12 years agoextensions: Don't perform strict comparisons on floating point values
Téo Mazars [Sat, 3 Aug 2013 16:15:15 +0000 (18:15 +0200)]
extensions: Don't perform strict comparisons on floating point values

12 years agoextensions: Lab has ab components in [-128, 127]
Téo Mazars [Sun, 30 Jun 2013 15:26:16 +0000 (17:26 +0200)]
extensions: Lab has ab components in [-128, 127]

12 years agoextensions: clamping to [0.0, 1.0] is not needed
Téo Mazars [Sun, 30 Jun 2013 13:58:43 +0000 (15:58 +0200)]
extensions: clamping to [0.0, 1.0] is not needed

As babl allows out of sRGB gamut values.

12 years agoextensions: do not truncate values to float
Téo Mazars [Sun, 30 Jun 2013 11:36:00 +0000 (13:36 +0200)]
extensions: do not truncate values to float

12 years agoextensions: Add an even more naive CMY color space to naive-CMYK.c
Téo Mazars [Thu, 27 Jun 2013 20:21:28 +0000 (22:21 +0200)]
extensions: Add an even more naive CMY color space to naive-CMYK.c

12 years agoextensions: naive-CMYK. works perceptually
Téo Mazars [Thu, 27 Jun 2013 19:12:53 +0000 (21:12 +0200)]
extensions: naive-CMYK. works perceptually

12 years agoextensions: Add the Y'CbCr ITU-R BT.709 Color Space
Téo Mazars [Wed, 26 Jun 2013 21:00:05 +0000 (23:00 +0200)]
extensions: Add the Y'CbCr ITU-R BT.709 Color Space

A variation of the current Y'CbCr (BT.601 or 470?), needed downstream.

12 years agoAdd hsl tests to gitignore
Téo Mazars [Mon, 24 Jun 2013 21:01:09 +0000 (23:01 +0200)]
Add hsl tests to gitignore

12 years agoextensions: Add the HSL color space
Téo Mazars [Mon, 24 Jun 2013 20:55:35 +0000 (22:55 +0200)]
extensions: Add the HSL color space

Needed at least as legacy

12 years agoextensions: Refactor HSV.c and add the simple "HSV" model
Téo Mazars [Thu, 20 Jun 2013 20:11:23 +0000 (22:11 +0200)]
extensions: Refactor HSV.c and add the simple "HSV" model

12 years agoextensions: Make HSV works on perceptual color space
Téo Mazars [Thu, 20 Jun 2013 18:16:17 +0000 (20:16 +0200)]
extensions: Make HSV works on perceptual color space

12 years agogegl-fixups: Fix warning about ambiguous sign
Daniel Sabo [Tue, 18 Jun 2013 04:48:39 +0000 (21:48 -0700)]
gegl-fixups: Fix warning about ambiguous sign

12 years agoGCC+Win32: Ensure stack alignment in SSE code
Daniel Sabo [Tue, 18 Jun 2013 04:33:49 +0000 (21:33 -0700)]
GCC+Win32: Ensure stack alignment in SSE code

Without this option GCC will generate bad code that attempts to
push SSE variables onto an unaligned stack.

12 years agoUse double constants in reference gamma
Daniel Sabo [Wed, 12 Jun 2013 22:20:10 +0000 (15:20 -0700)]
Use double constants in reference gamma

12 years agoRemove sse-fixups, superseded by sse2-int8
Daniel Sabo [Mon, 10 Jun 2013 23:51:40 +0000 (16:51 -0700)]
Remove sse-fixups, superseded by sse2-int8

12 years agoAdd SSE2 float -> byte conversions
Daniel Sabo [Mon, 10 Jun 2013 23:48:36 +0000 (16:48 -0700)]
Add SSE2 float -> byte conversions

12 years agoUse Loren's gamma conversions for RGB, YA, and Y
Daniel Sabo [Mon, 10 Jun 2013 16:48:00 +0000 (09:48 -0700)]
Use Loren's gamma conversions for RGB, YA, and Y

12 years agoLookup table based conversions for cairo-ARGB32
Daniel Sabo [Tue, 30 Apr 2013 18:52:51 +0000 (11:52 -0700)]
Lookup table based conversions for cairo-ARGB32

Because who doesn't love giant lookup tables?

12 years agoAdd two-table header to sources
Daniel Sabo [Fri, 31 May 2013 22:09:45 +0000 (15:09 -0700)]
Add two-table header to sources

12 years agoAdd two-table gamma conversions
Daniel Sabo [Fri, 31 May 2013 20:35:43 +0000 (13:35 -0700)]
Add two-table gamma conversions

This is kind of a silly conversion method, but it
works and nothing faster has been forthcoming.

12 years agoAdd some float conversions for grey
Daniel Sabo [Fri, 31 May 2013 20:25:28 +0000 (13:25 -0700)]
Add some float conversions for grey

12 years agoSSE2-optimized gamma correction
Loren Merritt [Mon, 29 Apr 2013 09:49:18 +0000 (09:49 +0000)]
SSE2-optimized gamma correction

7x faster than the scalar implementation.
(4x the obvious way from simd, and the other 1.75x because I'm exploiting
knowledge of the ieee754 float format rather than using portable frexp().)

12 years agoOptimize gamma correction
Loren Merritt [Thu, 25 Apr 2013 17:50:53 +0000 (17:50 +0000)]
Optimize gamma correction

Switch from Chebyshev polynomial to Newton's method, which is both simpler and
1.5x faster for the same precision.

12 years agoRemove rgbA float <-> rgba float from gggl-lies
Daniel Sabo [Tue, 30 Apr 2013 03:18:07 +0000 (20:18 -0700)]
Remove rgbA float <-> rgba float from gggl-lies

It clamps alpha when babl expects it not to.

12 years agogggl.c: Remove dead code
Daniel Sabo [Tue, 30 Apr 2013 03:13:10 +0000 (20:13 -0700)]
gggl.c: Remove dead code

12 years agogggl-lies.c: Remove dead code
Daniel Sabo [Tue, 30 Apr 2013 02:59:15 +0000 (19:59 -0700)]
gggl-lies.c: Remove dead code